<!-- Sidebar -->
<aside id="sidebar" role="complementary" class="sidebar">


    <section class="widget">         
        <?php if($this->customer):?>
            <div class="widget-title">Xin chào <?php echo $this->customer->nameDetect?></div>

            <ul class="custom-categories">
                <li><a title="Xem và Cập nhật tài khoản" href="<?php echo $this->createUrl('/web/customer/update')?>">Tài khoản</a></li>
                <li><a title="Đổi mật khẩu" href="<?php echo $this->createUrl('/web/customer/password')?>">Đổi mật khẩu</a></li>
                <li><a title="Danh sách đơn hàng" href="<?php echo $this->createUrl('/web/customer/bills')?>">Danh sách đơn hàng</a></li>
                <li style="text-align: right;"><a title="Thoát" href="<?php echo $this->createUrl('/web/customer/logout')?>">Thoát</a></li>
            </ul>
            <?php else:?>
            <div class="widget-title">Khách hàng đăng nhập</div>

            <form class="dt-form" action="<?php echo $this->createUrl('/web/customer/login')?>" method="post">
                <p class="form-phone">
                    <label for="phone" class="block">Số điện thoại</label>
                    <input type="text" placeholder="Số di động của bạn" name="LoginForm[username]"/>
                </p>
                <p class="form-password">
                    <label for="password" class="block">Mật khẩu</label>
                    <input type="password" placeholder="Mật khẩu" name="LoginForm[password]"/>
                </p>
                <p>
                    <button type="submit" class="dt-btn dt-btn-s flat">

                        <span class="icon-stack">
                            <i class="icon-check-empty icon-stack-base"></i>
                            <i class="icon-user"></i>
                        </span>
                        Đăng nhập</button>
                </p>
                <p>
                    <a href="<?php echo $this->createUrl('/web/customer/forgot')?>" title="Bạn không nhớ mật khẩu của mình ?">
                        <span class="label label-warning">Quên mật khẩu</span>
                    </a>
                </p> 
            </form>

            <?php endif?>
    </section>


    <!-- Categories -->
    <section class="widget">
        <div class="widget-title"><a href="<?php echo $this->createUrl('/web/post/index')?>">Bản Tin Giặt Là Vui</a></div>
        <ul class="custom-categories">
            <?php foreach($this->cats as $cat): if(!$cat->post_count) continue;?>
                <li><a title="View all posts of <?php echo CHtml::encode($cat->name)?>" href="<?php echo $cat->url?>"><span>(<?php echo CHtml::encode($cat->post_count)?>)</span> <?php echo $cat->name?></a></li>
                <?php endforeach?>
        </ul>
    </section><!-- .widget -->

    <section class="widget">
        <div class="widget-title">Facebook Fanpage</div>

        <div class="fb-like-box" data-href="<?php echo Yii::app()->params->facebook['fanPage']?>" data-width="250" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>

    </section><!-- .widget -->


    <!-- Recent posts -->
    <section class="widget">
        <div class="widget-title">Bài Viết Mới</div>
        <ul class="recent-posts">
            <?php foreach($this->latestPosts as $post):?>
                <li>
                    <article>
                        <a href="<?php echo $post->url?>" class="alignleft post-rollover" title=""><img width="60" src="<?php echo $post->imageUrlSmall?>" alt=""></a>
                        <div class="post-content">
                            <a href="<?php echo $post->url?>"><?php echo $post->title?></a><br>
                            <time pubdate="<?php echo $post->created?>" datetime="<?php echo $post->created?>" class="text-secondary"><?php echo $post->createdTime?></time>
                        </div>
                    </article>
                </li>
                <?php endforeach?>
        </ul>
    </section>

</aside><!-- #sidebar -->